package com.qfedu.openplateform.manager.service.impl;

import com.qfedu.openplateform.manager.dao.ApiMappingMapper;
import com.qfedu.openplateform.manager.entity.ApiMapping;
import com.qfedu.openplateform.manager.service.ApiMappingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ApiMappingServiceImpl implements ApiMappingService {

    @Autowired
    private ApiMappingMapper apiMappingMapper;

    @Override
    public List<ApiMapping> findAll() {
        return apiMappingMapper.findAll();
    }

    @Override
    public void add(ApiMapping apiMapping) {
        apiMappingMapper.add(apiMapping);
    }

    @Override
    public void delete(Integer[] ids) {
        for (int i = 0; i < ids.length; i++) {
            apiMappingMapper.delete(ids[i]);
        }
    }

    @Override
    public void update(ApiMapping apiMapping) {
        apiMappingMapper.update(apiMapping);
    }
}
